{extend name="property/public/insidePageBase" /}
{block name="title"}编辑文章{/block}
{block name="css"}
{css href="/static/common/lib/umeditor/themes/default/css/umeditor.css" /}
{__block__}
{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label required">封 面 图 片</label>
                <div class="layui-input-inline">
                    <input type="text" name="picture" value="{$info['picture']??''}" placeholder="请上传封面图片" id="picture" class="layui-input">
                </div>
                <img src="{$info['picture']??''}" class="checkPictureByImg picture" style="width: 80px;height: 40px;">
                <div class="layui-input-inline layui-btn-container" style="width: auto;">
                    <button type="button" class="layui-btn layui-btn-primary uploadImg" lay-data="{field: 'picture',data:{dir:'article/category', field:'picture'}}">
                        <i class="layui-icon">&#xe67c;</i>
                    </button>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="layui-form-item" pane="">
                        <label class="layui-form-label">是否显示</label>
                        <div class="layui-input-block">
                            <input type="radio" name="is_show" autocomplete="off" value="1" title="显示" {:isset($info['is_show']) ? $info['is_show'] == 1 ? 'checked' : '' : ''}>
                            <input type="radio" name="is_show" autocomplete="off" value="2" title="隐藏" {:isset($info['is_show']) ? $info['is_show'] == 2 ? 'checked' : '' : ''}>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="layui-form-item" pane="">
                        <label class="layui-form-label">是否置顶</label>
                        <div class="layui-input-block">
                            <input type="radio" name="is_top" autocomplete="off" value="1" title="置顶" {:isset($info['is_top']) ? $info['is_top'] == 1 ? 'checked' : '' : ''}>
                            <input type="radio" name="is_top" autocomplete="off" value="2" title="关闭" {:isset($info['is_top']) ? $info['is_top'] == 2 ? 'checked' : '' : ''}>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文 章 标 题</label>
                <div class="layui-input-block">
                <input type="text" name="title" value="{$info['title']??''}" class="layui-input" lay-verify="required" autocomplete="off"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">内容关键字</label>
                <div class="layui-input-block">
                    <input type="text" name="keywords" value="{$info['keywords']??''}" lay-verify="require" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">内 容 描 述</label>
                <div class="layui-input-block">
                    <input type="text" name="desc" value="{$info['desc']??''}" lay-verify="require" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">内容详情</label>
                <div class="layui-input-block">
                    <textarea id="content" name="content" placeholder="请输入内容"  class="layui-textarea">{:htmlspecialchars_decode($info['content']??'')}</textarea>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn" type="button" lay-submit lay-filter="submitBtn" id="submitBtn">提交</button>
            </div>
        </form>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
<script src="/static/common/lib/umeditor/umeditor.config.js"></script>
<script src="/static/common/lib/umeditor/umeditor.min.js"></script>
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer, $ = layui.$;
        var editor = UM.getEditor('content', {
            initialFrameWidth: 769,
            initialFrameHeight: 400,
            zIndex: 1
        })
        $('.uploadImg').selectImages({
            confirm:function(res,elem,data) {
                $('#' + data.field).val(res[0].src);
                $('.' + data.field).attr('src',res[0].src)
            }
        });
    })
</script>
{/block}